﻿using Kanban.Dapper.Dal;
using Kanban.IDal;
using Kanban.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kanban.Dal
{
    public class Speed_SettingDal : BaseDal<Speed_Setting>, ISpeed_SettingDal
    {
        public Speed_SettingDal()
        {
            TableName = "Speed_Setting";
        }

        public Task<Tuple<IList<object>, int>> GetModelsByPageAsync(string search, int pageSize, int pageIndex)
        {
            string whereSql = "1 = 1";
            if (!string.IsNullOrEmpty(search))
            {
                whereSql += $" AND (Type LIKE '%{search}%')";
            }
            return GetModelsByPageAsync("*", whereSql, "Id DESC", pageSize, pageIndex);
        }
    }
}
